// web/src/app/api/(forum)/comments/route.ts
import {NextRequest, NextResponse} from "next/server";
import {db} from "@/lib/db";

export async function POST(req: NextRequest) {
    try {
        let json = await req.json()
        const comment = await db.comment.create({
            data: json
        })
        return NextResponse.json({comment})
    } catch (err) {
        console.error(err)
        return NextResponse.json({err})
    }
}